﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once

#include "GcmpModel.h"
#include "GcmpApiDeclaration.h"

namespace gcmp 
{ 
    class ICategory;
    class UniIdentity;
    
    // 族类别与主文档类别映射回调
    class GCMP_MODEL_EXPORT IMergeFamilyCategory2HostDocCallback
    {
    public:
        /// \brief 析构函数
        virtual ~IMergeFamilyCategory2HostDocCallback() {}

        /// \brief 建立族文档类别与主文档类别的映射，同时返回需新创建类别的父子关系
        ///
        /// \param hostCategories 主文档类别
        /// \param familyCategories 族文档类别
        /// \param mapOfFamilyCategory2HostCategory 族类别对应主文档类别的完整映射结果（主文档不存在的类别需要提供新的类别的UniIdentity）
        /// \param mapOfNewCategory2ParentCategory 需要新创建的主文档类别Uid以及它父类别的Uid的映射（没有父类别使用UniIdentity::invalid）
        virtual void MergeFamilyCategories2HostDoc(const std::vector<const gcmp::ICategory*>& hostCategories, const std::vector<const gcmp::ICategory*>& familyCategories,
            std::map<UniIdentity, UniIdentity>& mapOfFamilyCategory2HostCategory, std::map<UniIdentity, UniIdentity>& mapOfNewCategory2ParentCategory) const = 0;
    };

}// namespace gcmp

